package my.controller;

import com.jfinal.core.Controller;

/**
 * Created by Rajab on 2017/03/30.
 */
public class MainController extends Controller {

    public void index() {
        renderHtml("<h1>hello!</h1>");
    }
    public void hello(){
        String name=getPara("name");
        String age=getPara("age");
        renderText(String.format("naem:%s,age:%s",name,age));
    }
    public void login(){
        String name=getPara("uname");
        String password=getPara("upass");
        if(name.equals("yanghu")&&password.equals("123456")){
            renderFreeMarker("success.html");
        }
        else{
            redirect("login.html");
        }
    }
}
